package basics.day20.MapDemo;

import java.util.LinkedHashMap;
import java.util.Map;
/*
 * LinkedHashMap 是有序的map，有先后顺序
 * */

public class LinkedHashMapDemo {
    public static void main(String[] args) {
        LinkedHashMap<String, Integer> map = new LinkedHashMap<String, Integer>();
        map.put("一", 1);
        map.put("六", 2);
        map.put("五", 3);
        map.put("四", 4);
        System.out.println(map);
        for (String key :
                map.keySet()) {
            Integer value = map.get(key);
            System.out.println(key + "=====" + value);

        }
        System.out.println("=================");
        for (Map.Entry<String, Integer> entry :
                map.entrySet()) {
            String key = entry.getKey();
            Integer value = entry.getValue();
            System.out.println(key + "=====" + value);

        }
    }
}
